package com.futurelight.recipes.model;

/**
 * 网络或本地数据请求封装类
 * @param <T>
 */
public class Common<T> {
    protected T data;
    protected String message;
    public static class Success<T> extends Common {
        public Success(T data){
            super(data);
        }
        public T getData(){
            return (T)data;
        }
    }
    public static class Error extends Common{
        public Error(String message){
            super(message);
        }
        public String getMessage(){
            return message;
        }
    }

    public static class Loading extends Common{
        public Loading(){}
    }

    public Common(T data){
        this.data = data;
    }
    public Common(String message){
        this.message = message;
    }

    public Common(T data, String message) {
        this.data = data;
        this.message = message;
    }
    public Common(){

    }
}
